//
// Created on 6/1/25.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef NEURONVIEW_GEOMETRY_H
#define NEURONVIEW_GEOMETRY_H
#include "vertex.h"
#include "glm/vec3.hpp"
#include "node.h"
struct BBox{
    glm::vec3 min;
    glm::vec3 max;
    glm::vec3 getCenter(){return (min+max)/2.0f;}
};
enum class PrimitiveType{
POINTS,
TRIANGLES,
LINES
};
class Geometry:public Node {
public:
    Geometry();
    virtual ~Geometry();
    void SetVertex(std::shared_ptr<VertexProp> vertex);
    std::shared_ptr<VertexProp> GetVertex();
    void* GetVertexPoint(Property property);
    int GetVertexSize(Property property);
    void SetBBox(glm::vec3 min,glm::vec3 max);
    BBox GetBBox(){return m_bbox;}
    void SetPrimitiveType(PrimitiveType type);
    PrimitiveType GetPrimitiveType();
private:
    std::shared_ptr<VertexProp> m_Vertex;
    std::shared_ptr<PropertyType<int>> m_Index;
    PrimitiveType m_Type = PrimitiveType::LINES;
    BBox m_bbox;
};

#endif // NEURONVIEW_GEOMETRY_H
